import Observer from "./Observer";

export default function observe(data) {
    if (typeof data !== 'object') {
        return;
    }

    /* if(typeof data.__ob__ === 'undefined') {
        data.__ob__ = new Observer(data);
    } */

    // 定义ob
    var ob;
    if (typeof data.__ob__ !== 'undefined') {
        ob = data.__ob__;
    } else {
        ob = new Observer(data);
    }
    return ob;
}